<?php
/**
 * 根据source 判断使用哪个微信配置
 * @author guohui 2014/5/27 16:00
 * @param accesstoken 区分微信的accesstoken
 * @param weixinhao   微信公众号
 * @param weixin_auth  微信认证，第一次发布时许开启
 * @param token     微信token
 * @param appid     微信appid
 * @param appsecret  微信appsecret
 * @param client_id  申请的id 标示应用
 * @param host_memsys 会员体系的host  如：https://passort.24cp.com/
 * @param algorithm  加密方式     签名算法，MD5（默认），RSA、3DES
 * @param key_memsys 加密所使用的key   3DES:DE76E3EC39801CEEE04400144F674217  MD5:8a3d4b8a3f13bc8c013f13bc8c9c0000
 */
//合作号
$weixin_weicaipiao = array(
    'ACCESSTOKEN'=>WCP_ACCESSTOKEN,
    'WEIXINHAO'=>WCP_WEIXINHAO,
    'TOKEN'=>WCP_TOKEN,
    'APPID'=>WCP_APPID,
    'APPSECRET'=>WCP_APPSECRET,
    'CLIENT_ID'=>WCP_CLIENT_ID,
    'CLIENT_SECRET'=>WCP_CLIENT_SECRET
);

//平安产险
$weixin_pinganchanxian = array(
    'ACCESSTOKEN'=>'',
    'WEIXINHAO'=>PACX_WEIXINHAO,
    'TOKEN'=>'',
    'APPID'=>PACX_APPID,
    'APPSECRET'=>'',
    'CLIENT_ID'=>PACX_CLIENT_ID,
    'CLIENT_SECRET'=>PACX_CLIENT_SECRET,
    'ACCESSTOKEN_REDIRECT'=>PAHC_ACCESSTOKEN
);

//自有服务号
$weixin_base = array(
    'ACCESSTOKEN'=>PAHC_ACCESSTOKEN,
    'WEIXINHAO'=>PAHC_WEIXINHAO,
    'TOKEN'=>PAHC_TOKEN,
    'APPID'=>PAHC_APPID,
    'APPSECRET'=>PAHC_APPSECRET,
    'CLIENT_ID'=>PAHC_CLIENT_ID,
    'CLIENT_SECRET'=>PAHC_CLIENT_SECRET
);

$weixin = array(
    'IS_WEIXIN'=>1,
    'WEIXIN_AUTH'=>WX_AUTH,//微信认证开关
    'WEIXIN_SET_IP'=>'172.16.132.40|172.16.132.39|172.16.132.4|172.16.132.3|172.16.128.67|172.16.128.60',
    'HOST_MEMSYS'=>'https://passport.24cp.com/',
    'ALGORITHM'=>'SHA1',
    'DES3_KEY_MEMSYS'=>'DE76E3EC39801CEEE0440014',
    'SHA1_KEY_MEMSYS'=>'8a3d4b8a3f13bc8c013f13bc8c9c0000',
    'WEIXIN_PUSH_IP'=>'172.16.128.45|172.16.128.46|127.0.0.1|25.17.1.104',
    
);
$con_arr = array();
if(isset($_GET['source'])){
    if($_GET['source'] == 'weicaipiao'){
        $con_arr = $weixin_weicaipiao;
    }elseif($_GET['source'] == 'pinganchanxian'){
        $con_arr = $weixin_pinganchanxian;
    }else{
        $con_arr = $weixin_base;
    }
}elseif(isset($_COOKIE['source'])){
    if($_COOKIE['source'] == 'weicaipiao'){
        $con_arr = $weixin_weicaipiao;
    }elseif($_COOKIE['source'] == 'pinganchanxian'){
        $con_arr = $weixin_pinganchanxian;
    }else{
        $con_arr = $weixin_base;
    }
}else{
    $con_arr = $weixin_base;
}

return array_merge($weixin,$con_arr)
?>
